{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\myogo\Princeton Dropbox\Motohiro Yogo\Koijen Yogo - International\JPE\Replication\Code\5 Decomposition\Tables1.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}31 Oct 2025, 20:17:28
{txt}
{com}. /* Define local and global variables */
> 
> local path = "../../figures";
{txt}
{com}. local clist = "^(GRC|ITA|PRT)$";
{txt}
{com}. /* Step 1: Variance decomposition */
> 
> /* Load data */
> 
> u year counter_euro Name type Dyield*
>         if regexm(counter_euro,"`clist'") & type==2
>         using Decomposition0, clear;
{txt}
{com}. /* Loop by country */
> 
> levelsof Name;
{res}{txt}`"Greece"' `"Italy"' `"Portugal"'

{com}. foreach i in `r(levels)' {c -(};
{txt}  2{com}.         /* Estimate variance decomposition */
> 
>         qui forval j = 1/9 {c -(};
{txt}  3{com}.                 reg Dyield`j' Dyield if Name=="`i'", robust;
{txt}  4{com}.                 eststo Dyield`j';
{txt}  5{com}.         {c )-};
{txt}  6{com}.         /* Table: Variance decomposition */
> 
>         esttab, b(%8.2f) se(%8.2f) plain
>                 keep(Dyield);
{txt}  7{com}.         eststo clear;
{txt}  8{com}. {c )-};
{res}
{txt}                  Dyield1      Dyield2      Dyield3      Dyield4      Dyield5      Dyield6      Dyield7      Dyield8      Dyield9
{txt}                     b/se         b/se         b/se         b/se         b/se         b/se         b/se         b/se         b/se
{txt}Dyield      {res}         0.22         0.46         0.00         0.01         0.19         0.02         0.08         0.02         0.32{txt}
            {res}         0.11         0.09         0.01         0.01         0.01         0.00         0.02         0.01         0.03{txt}
{txt}N           {res}           17           17           17           17           17           17           17           17           17{txt}
{res}
{txt}                  Dyield1      Dyield2      Dyield3      Dyield4      Dyield5      Dyield6      Dyield7      Dyield8      Dyield9
{txt}                     b/se         b/se         b/se         b/se         b/se         b/se         b/se         b/se         b/se
{txt}Dyield      {res}         0.14        -0.28         0.02         0.08         0.98         0.05        -0.00         0.01         1.15{txt}
            {res}         0.17         0.17         0.09         0.07         0.19         0.02         0.01         0.00         0.31{txt}
{txt}N           {res}           17           17           17           17           17           17           17           17           17{txt}
{res}
{txt}                  Dyield1      Dyield2      Dyield3      Dyield4      Dyield5      Dyield6      Dyield7      Dyield8      Dyield9
{txt}                     b/se         b/se         b/se         b/se         b/se         b/se         b/se         b/se         b/se
{txt}Dyield      {res}         0.24         0.02        -0.01         0.05         0.65         0.05        -0.00         0.01         0.74{txt}
            {res}         0.04         0.19         0.03         0.03         0.16         0.01         0.00         0.00         0.21{txt}
{txt}N           {res}           17           17           17           17           17           17           17           17           17{txt}

{com}. /* Step 2: Plot figures */
> 
> /* Report in percent */
> 
> qui foreach var of varlist Dyield* {c -(};
{txt}
{com}. /* Specify panel labels */
> 
> replace Name = "A. Greece" if Name=="Greece";
{txt}(17 real changes made)

{com}. replace Name = "B. Italy" if Name=="Italy";
{txt}(17 real changes made)

{com}. replace Name = "C. Portugal" if Name=="Portugal";
{txt}(17 real changes made)

{com}. /* Label variables */
> 
> label var Dyield        "Change in yield";
{txt}
{com}. label var Dyield2       "Macro variables";
{txt}
{com}. label var Dyield9       "Latent demand";
{txt}
{com}. /* Figure: Change in yield by country */
> 
> twoway line Dyield Dyield2 Dyield9 year
>         if counter_euro=="GRC",
>         by(Name, legend(pos(12) at(2)) note(""))
>         lc(black gs4 gs8)
>         lp(solid dash longdash)
>         ylabel(-20(10)20, angle(0))
>         tlabel(2004(4)2020)
>         ytitle("Change in yield (%)")
>         legend(col(1) order(1 - "due to" 2 3))
>         xsize(6) ysize(3)
>         saving(GRC, replace);
{res}{txt}{p 0 4 2}
(file {bf}
GRC.gph{rm}
not found)
{p_end}
{res}{txt}file {bf:GRC.gph} saved

{com}. twoway line Dyield Dyield2 Dyield9 year
>         if inlist(counter_euro,"ITA","PRT"),
>         by(Name, legend(off) note(""))
>         lc(black gs4 gs8)
>         lp(solid dash longdash)
>         ylabel(-10(5)10, angle(0))
>         tlabel(2004(4)2020)
>         ytitle("Change in yield (%)")
>         xsize(6) ysize(3)
>         saving(ITA, replace);
{res}{txt}{p 0 4 2}
(file {bf}
ITA.gph{rm}
not found)
{p_end}
{res}{txt}file {bf:ITA.gph} saved

{com}. /* Output figure */
> 
> graph combine GRC.gph ITA.gph,
>     rows(2) altshrink xsize(6) ysize(6);
{res}{txt}
{com}. graph export "`path'/Euro.eps", replace;
{txt}{p 0 4 2}
(file {bf}
../../figures/Euro.eps{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
../../figures/Euro.eps{rm}
saved as
EPS
format
{p_end}

{com}. rm GRC.gph;
{txt}
{com}. rm ITA.gph;
{txt}
{com}. log close;
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\myogo\Princeton Dropbox\Motohiro Yogo\Koijen Yogo - International\JPE\Replication\Code\5 Decomposition\Tables1.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}31 Oct 2025, 20:17:44
{txt}{.-}
{smcl}
{txt}{sf}{ul off}